enum UserSex {
  MALE('男'),
  FEMALE('女'),
  UNKNOWN('保密');

  const UserSex(this.value);

  final String value;

  /// 根据 value 返回 index
  static int? getIndex(String value) {
    for (var element in UserSex.values) {
      if (element.value == value) {
        return element.index;
      }
    }

    return null;
  }
}
